package series

const testVersion = 2

func All(n int, s string) (r []string) {
	if n > len(s) {
		return nil
	}
	for i := 0; i < len(s)-n+1; i++ {
		r = append(r, s[i:i+n])
	}

	return
}

func First(n int, s string) (r string, ok bool) {
	t := All(n, s)
	if t == nil {
		r = ""
		ok = false
		return
	}
	r = t[0]
	ok = true
	return
}

func UnsafeFirst(n int, s string) (r string) {
	t := All(n, s)
	r = t[0]
	return
}
